cmake_minimum_required(VERSION 3.8)
project(manipulation)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

# Install Message Files
rosidl_generate_interfaces(${PROJECT_NAME}
  "msg/ManiProcessCmd.msg"
  "msg/TargetsList.msg"
  DEPENDENCIES std_msgs
)

# Install Python
install(PROGRAMS
  scripts/mani_core.py
  DESTINATION lib/${PROJECT_NAME}
)

# Install Python Modules By Symlinking
install(CODE "
  execute_process(
    COMMAND ${CMAKE_COMMAND} -E create_symlink
    ${CMAKE_CURRENT_SOURCE_DIR}/scripts
    ${CMAKE_INSTALL_PREFIX}/local/lib/python3.10/dist-packages/${PROJECT_NAME}/scripts
  )
")

ament_package()
